/********************************************************************
Name: Table A8: Comparison of Election Sample to Universe of 
	Sheriff Elections
Author: Dan Thompson
Date: August 2019
Notes:
********************************************************************/

* Set the working directory 
gl root = "$sanctuary_root"
gl root = "YOUR_WORKING_DIRECTORY"

* Bring in the Trump RD analysis data
use "$root/data/rd analysis data.dta", clear

* Column 1
reg enforcement treat rv treat_rv if abs(rv)<10, robust
reg in_287g treat rv treat_rv if abs(rv)<10, robust
reg sanctuary treat rv treat_rv if abs(rv)<10, robust

* Column 2
reg enforcement treat rv rv2 rv3 if abs(rv)<25, robust
reg in_287g treat rv rv2 rv3 if abs(rv)<25, robust
reg sanctuary treat rv rv2 rv3 if abs(rv)<25, robust

* Column 3
reg enforcement treat rv rv2 rv3 treat_rv treat_rv2 treat_rv3 if abs(rv)<25, robust
reg in_287g treat rv rv2 rv3 treat_rv treat_rv2 treat_rv3 if abs(rv)<25, robust
reg sanctuary treat rv rv2 rv3 treat_rv treat_rv2 treat_rv3 if abs(rv)<25, robust

* Column 4
reg enforcement treat rv rv2 rv3 rv4 rv5 if abs(rv)<25, robust
reg in_287g treat rv rv2 rv3 rv4 rv5 if abs(rv)<25, robust
reg sanctuary treat rv rv2 rv4 rv5 rv3 if abs(rv)<25, robust

* Column 5
rdrobust enforcement rv, vce(cluster election_id)
rdrobust in_287g rv, vce(cluster election_id)
rdrobust sanctuary rv, vce(cluster election_id)
